package com.focusai.efairy.network.exception;


import com.focusai.efairy.network.NetErrorCode;

/**
 * Created by heqingbao on 2016/8/3.
 */
public class NetworkException extends Exception {

    int errorCode = NetErrorCode.NET_ERROR;

    public NetworkException() {
    }
    public NetworkException(int errorCode,String detailMessage) {
        super(detailMessage);
        this.errorCode = errorCode;
    }
    public NetworkException(String detailMessage) {
        super(detailMessage);
    }

    public NetworkException(Throwable throwable) {
        super(throwable);
    }

    public NetworkException(String detailMessage, Throwable reason) {
        super(detailMessage, reason);
    }

    public int getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return "你的网络异常，请查看或重试(" + getErrorCode() + ")";
    }
}
